const Service = require('egg').Service;

class TargetService extends Service {
    /**
     * 创建分享目标
     *
     * @param {*} data
     * @returns
     * @memberof TargetService
     */
    async createTarget(data) {
        return new Promise(async (resolve, reject) => {
            this.ctx.model.Target({
                ...data
            }).save((err, data) => {
                if (err) {
                    reject(err);
                    return
                }
                resolve(data)
            });
        })
    }
}
module.exports = TargetService;